package cn.itcast.com.Thread;

public class PriorityThread {
    public static void main(String[] args) {
        PriorityThread1 priorityThread1 = new PriorityThread1();
        priorityThread1.setPriority(1);
        priorityThread1.setName("minPriority");
        System.out.println(priorityThread1.getPriority());
        PriorityThread1 priorityThread11 = new PriorityThread1();
        priorityThread11.setPriority(10);
        priorityThread11.setName("MAXPriority");
        priorityThread1.start();
        priorityThread11.start();
    }
}

class PriorityThread1 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName()+" "+i);
        }
    }
}
